#!/bin/csh

# Sorts a byte data file by username and then timestamp
# Single worker instance processes one file.

# Specify a filename to work on (should be local e.g not fully qualified name)
# Specify the input directory where the input file is
# Specify an output directory to put the output in

set filename = $1
set inputdir = $2
set outputdir = $3

echo `date` Sorting byte data from file $inputdir/$filename to $outputdir/$filename.

sort -o $outputdir/$filename -k 1,1 -k 6,6 -t '	' $inputdir/$filename 

echo `date` Finished sorting byte data from file $inputdir/$filename to $outputdir/$filename.
